package com.defangit.award.extend.wxmp.rest;

import com.defangit.award.extend.wxmp.orm.WxmpUserService;
import org.hibernate.annotations.SortComparator;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * Created by zhangfagen on 2019/1/10.
 */
@Path("wxmpUser")
public class WxmpUserResource {
    private WxmpUserService userSvr=new WxmpUserService();
    @GET @Produces("application/json")
    public Response all(){
        return Response.ok(
                userSvr.all()
        ).build();
    }
    @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    public boolean addUser(@FormParam("openid") String openId,@FormParam("gh") String gh){
        return userSvr.addUser(openId,gh,0);
    }
}
